package drongo.model.values
{
	import drongo.model.core.BaseValue;

	/**
	 * 浮点数值
	 */
	public class NumberValue extends BaseValue
	{
		public function NumberValue()
		{
			super();
			this.value=0;
		}
		
		override protected function ChackValue(value:*):void
		{
			if(isNaN(value)){
				throw new Error("设置数值非数字类型!");
			}
			//整数
			if(value-Math.floor(value)==0){
				if(value<0){
					if(value<int.MIN_VALUE||value>int.MAX_VALUE){
						throw new Error("数值超出int范围！");
					}
				}else{
					if(value<uint.MIN_VALUE||value>uint.MAX_VALUE){
						throw new Error("数值超出uint范围！");
					}
				}
			}else{
				if(value<Number.MIN_VALUE||value>Number.MAX_VALUE){
					throw new Error("数值超出Number的范围！");
				}
			}
		}
	}
}